const {
	http
} = uni.$u;

const make_add_function = () => {
	let id = 1;
	return () => {
		return id++;
	};
};
const add_id = make_add_function();
export const formatParams = (params) => {
	let id = add_id();
	let data = {
		jsonrpc: "2.0",
		id: id,
		params: params,
	};
	return data;
};

export const wxgetuserphonenumber = (params, config = {}) => {
	let data = formatParams(params);
	return http.post("/weixin/getuserphonenumber", data, config);
};

export const session_info = (params, config = {}) => {
	let data = formatParams(params);
	return http.get("/suzhoutuancan_beienqixie_company/session_info", data, config);
};
// 可点的菜品
export const packed_order_dish_data = (params, config = {}) => {
	let data = formatParams(params);
	return http.post("/packed_order/packed_order_dish_data", data, config);
};

// 当前人员的历史记录
export const get_ordered_dish_data = (params, config = {}) => {
	let data = formatParams(params);
	return http.post("/packed_order/get_ordered_dish_data", data, config);
};
//订单创建
export const common_create = (params, config = {}) => {
	let data = formatParams(params);
	return http.post("/sudo/common_create", data, config);
};
//订单删除
export const common_delete = (params, config = {}) => {
	let data = formatParams(params);
	return http.post("/sudo/common_delete", data, config);
};
//订单删除
export const common_write = (params, config = {}) => {
	let data = formatParams(params);
	return http.post("/sudo/common_write", data, config);
};